package com.example.administrator.hqq.config;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * @name: HQQ
 * @describe:用于管理Url
 * @author: 康海涛 QQ2541849981
 * @time: 2018/10/29 17:39
 * @remark:
 */
public class UrlFactory {
    private final static String urlLincChar = "/";
    private static String user = "user";
    private static String v1 = "v1";
    private static String get_code = "get_code";
    private static String verify_code = "verify_code";
    private static String get_all_portrait = "get_all_portrait";
    private static String topic = "topic";
    private static String register = "register";
    private static String verify_token = "verify_token";
    private static String group = "group";
    private static String get_qiniu_token = "get_qiniu_token";
    private static String add = "add";
    private static String get_user_topic = "get_user_topic";
    private static String get_all_folder = "get_all_folder";
    private static String usertopic = "usertopic";
    private static String tool = "tool";
    private static String system = "system";
    private static String get_commend_topic = "get_commend_topic";
    private static String get_all_topic_category = "get_all_topic_category";
    private static String get_checked_topic_by_category = "get_checked_topic_by_category";
    private static String get_all_category = "get_all_category";
    private static String get_topic_by_category = "get_topic_by_category";
    private static String list = "list";
    private static String check="check";
    private static String get_user_info="get_user_info";
    private static String get_join_introduction="get_join_introduction";
    private static String apply="apply";
    private static String join="join";
    private static String qiniu="qiniu";
    private static String get_settings="get_settings";
    private static String set_is_muted="set_is_muted";
    private static String set_chat_permission="set_chat_permission";
    private static String set_join_introduction="set_join_introduction";
    private static String set_new_owner="set_new_owner";
    private static String passive_exit="passive_exit";
    private static String active_exit="active_exit";
    private static String forum="forum";
    private static String forum_like="forum_like";
    private static String get_forum_content="get_forum_content";
    private static String get_forum_reply="get_forum_reply";
    private static String prepare_add="prepare_add";
    private static String forum_collect="forum_collect";
    private static String reply="reply";
    private static String get_discussion="get_discussion";
    private static String reply_like="reply_like";
    private static String discuss_reply="discuss_reply";
    private static String discuss_discussion="discuss_discussion";
    private static String discussion_like="discussion_like";
    private static String list_all="list_all";
    private static String delete_user_topic="delete_user_topic";
    private static String get_group_info="get_group_info";
    private static String get_contact_list="get_contact_list";
    private static String dialog="dialog";
    private static String refresh_sequence="refresh_sequence";
    private static String delete_contact="delete_contact";
    private static String directchat="directchat";
    private static String get_title="get_title";
    private static String get_collection_forum="get_collection_forum";
    private static String get_my_forum="get_my_forum";
    private static String set_url="set_url";
    private static String set_nickname="set_nickname";
    private static String report="report";
    private static String report_forum="report_forum";
    private static String report_normal="report_normal";
    private static String complaint="complaint";
    private static String complaint_normal="complaint_normal";
    private static String get_all_checked_topic="get_all_checked_topic";
    private static String news="news";
    private static String get_forum_news="get_forum_news";
    private static String bulk_set_user_topic="bulk_set_user_topic";
    private static String apply_new_topic="apply_new_topic";
    private static String notice="notice";
    private static String list_notice="list_notice";
    private static String accept_join_group_notice="accept_join_group_notice";
    private static String deny_join_group_notice="deny_join_group_notice";
    private static String dating="dating";
    private static String get_dating_detail="get_dating_detail";
    private static String set_top="set_top";
    private static String delete_dating="delete_dating";
    private static String prepare_set_dating_info="prepare_set_dating_info";
    private static String set_dating_info="set_dating_info";
    private static String check_chat_permission="check_chat_permission";
    private static String get_search_history="get_search_history";
    private static String search="search";
    private static String delete_my_forum="delete_my_forum";
    private static String set_user_location="set_user_location";
    private static String set_group_top="set_group_top";
    private static String set_group_title="set_group_title";
    private static String set_group_url="set_group_url";
    private static String delete_search_history="delete_search_history";
    private static String check_android_version="check_android_version";
    private static String prepare_complaint="prepare_complaint";
    private static String rongyun="rongyun";
    private static String get_rongyun_message_from_app="get_rongyun_message_from_app";
    private static String get_my_group="get_my_group";
    private static String mvp="mvp";
    private static String list_all_mvp_topic="list_all_mvp_topic";

    //拼接url
    private static String linkString(String linkToken, String... strings) {
        StringBuilder sb = new StringBuilder();
        for (String string : strings) {
            sb.append(string).append(linkToken);
        }
        String url = sb.toString().substring(0, sb.toString().length() - 1);
        Log.e("网络请求地址", url);
        return url;
    }

    /**
     * 获取短信验证码
     */
    public static String getUserVerificationCode() {
        String[] parms = {ENV.getHttpHost(), user, v1, get_code};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取短信验证登录
     */
    public static String UserLogin() {
        String[] parms = {ENV.getHttpHost(), user, v1, verify_code};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取头像
     */
    public static String getHeadPortrait() {
        String[] parms = {ENV.getHttpHost(), user, v1, get_all_portrait};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取推荐话题
     */
    public static String getHobbies() {
        String[] parms = {ENV.getHttpHost(), topic, v1, get_commend_topic};
        return linkString(urlLincChar, parms);
    }

    /**
     * 注册
     */
    public static String register() {
        String[] parms = {ENV.getHttpHost(), user, v1, register};
        return linkString(urlLincChar, parms);
    }

    /**
     * login
     */
    public static String login() {
        String[] parms = {ENV.getHttpHost(), user, v1, verify_token};
        return linkString(urlLincChar, parms);
    }

    /**
     */
    public static String getQNToken() {
        String[] parms = {ENV.getHttpHost(), qiniu, v1, get_qiniu_token};
        return linkString(urlLincChar, parms);
    }

    /**
     * addGroup
     */
    public static String addGroup() {
        String[] parms = {ENV.getHttpHost(), group, v1, add};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取常规模块内容
     */
    public static String getUserFolder() {
        String[] parms = {ENV.getHttpHost(), usertopic, v1, list_all};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取所有已审核所有话题
     */
    public static String getAllTopic() {
        String[] parms = {ENV.getHttpHost(), topic, v1, get_checked_topic_by_category};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取类别所有的子话题
     */
    public static String getCheckenTopic() {
        String[] parms = {ENV.getHttpHost(), topic, v1, get_topic_by_category};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取群聊列表
     */
    public static String getGroupList() {
        String[] parms = {ENV.getHttpHost(), group, v1, list};
        return linkString(urlLincChar, parms);
    }

    /**
     * 进群检测
     */
    public static String getGroupCheck() {
        String[] parms = {ENV.getHttpHost(), group, v1, check};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取用户信息
     */
    public static String getUserInfo() {
        String[] parms = {ENV.getHttpHost(), user, v1, get_user_info};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取加群展示信息
     */
    public static String getJoinIntroduction() {
        String[] parms = {ENV.getHttpHost(), group, v1, get_join_introduction};
        return linkString(urlLincChar, parms);
    }

    /**
     * 申请加入群聊
     */
    public static String getJoinApply() {
        String[] parms = {ENV.getHttpHost(), group, v1, apply};
        return linkString(urlLincChar, parms);
    }

    /**
     * 加入群聊
     */
    public static String getJoin() {
        String[] parms = {ENV.getHttpHost(), group, v1, join};
        return linkString(urlLincChar, parms);
    }

    /**
     * 群设置页面信息
     */
    public static String getGroupSettings() {
        String[] parms = {ENV.getHttpHost(), group, v1, get_settings};
        return linkString(urlLincChar, parms);
    }

    /**
     * 消息免打扰
     */
    public static String setMuted() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_is_muted};
        return linkString(urlLincChar, parms);
    }

    /**
     * 设置私聊许可
     */
    public static String setPermission() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_chat_permission};
        return linkString(urlLincChar, parms);
    }

    /**
     * 更改群设置
     */
    public static String setJoinIntroduction() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_join_introduction};
        return linkString(urlLincChar, parms);
    }

    /**
     * 更改群主
     */
    public static String setNewOwner() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_new_owner};
        return linkString(urlLincChar, parms);
    }

    /**
     * 群主踢人
     */
    public static String setPassiveExit() {
        String[] parms = {ENV.getHttpHost(), group, v1, passive_exit};
        return linkString(urlLincChar, parms);
    }

    /**
     * 主动退群
     */
    public static String setActiveExit() {
        String[] parms = {ENV.getHttpHost(), group, v1, active_exit};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取贴子列表
     */
    public static String getForumList() {
        String[] parms = {ENV.getHttpHost(), forum, v1, list};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取贴子点赞和取消点赞
     */
    public static String getForumlike() {
        String[] parms = {ENV.getHttpHost(), forum, v1, forum_like};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取贴子内容和图片
     */
    public static String getForumComtent() {
        String[] parms = {ENV.getHttpHost(), forum, v1, get_forum_content};
        return linkString(urlLincChar, parms);
    }

    /**
     * 分页获取评论
     */
    public static String getForumReply() {
        String[] parms = {ENV.getHttpHost(), forum, v1, get_forum_reply};
        return linkString(urlLincChar, parms);
    }

    /**
     * 准备创建贴子
     */
    public static String getPrepare_add() {
        String[] parms = {ENV.getHttpHost(), forum, v1, prepare_add};
        return linkString(urlLincChar, parms);
    }

    /**
     * 准备创建贴子
     */
    public static String getGROUPPrepare_add() {
        String[] parms = {ENV.getHttpHost(), group, v1, prepare_add};
        return linkString(urlLincChar, parms);
    }


    /**
     * 创建帖子
     */
    public static String getforumadd() {
        String[] parms = {ENV.getHttpHost(), forum, v1, add};
        return linkString(urlLincChar, parms);
    }

    /**
     * 帖子收藏
     */
    public static String getForumCollect() {
        String[] parms = {ENV.getHttpHost(), forum, v1, forum_collect};
        return linkString(urlLincChar, parms);
    }

    /**
     * 回复贴子
     */
    public static String reolyForum() {
        String[] parms = {ENV.getHttpHost(), forum, v1, reply};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取评论详情
     */
    public static String getDiscussion() {
        String[] parms = {ENV.getHttpHost(), forum, v1, get_discussion};
        return linkString(urlLincChar, parms);
    }

    /**
     * 一级评论点赞
     */
    public static String getReplyLike() {
        String[] parms = {ENV.getHttpHost(), forum, v1, reply_like};
        return linkString(urlLincChar, parms);
    }

    /**
     * 回复一级评论
     */
    public static String getDiscussReply() {
        String[] parms = {ENV.getHttpHost(), forum, v1, discuss_reply};
        return linkString(urlLincChar, parms);
    }

    /**
     * 回复二级评论
     */
    public static String getDiscussDiscussion() {
        String[] parms = {ENV.getHttpHost(), forum, v1, discuss_discussion};
        return linkString(urlLincChar, parms);
    }

    /**
     * 二级评论点赞
     */
    public static String getDiscussLike() {
        String[] parms = {ENV.getHttpHost(), forum, v1, discussion_like};
        return linkString(urlLincChar, parms);
    }

    /**
     *删除用户话题
     */
    public static String getUsertopicDeleteUserTopic() {
        String[] parms = {ENV.getHttpHost(), usertopic, v1, delete_user_topic};
        return linkString(urlLincChar, parms);
    }

    /**
     *获取群组pic和title
     */
    public static String getGroupInfo() {
        String[] parms = {ENV.getHttpHost(), group, v1, get_group_info};
        return linkString(urlLincChar, parms);
    }

    /**
     *获取所有联系人
     */
    public static String getGetcontactlist() {
        String[] parms = {ENV.getHttpHost(), dialog, v1, get_contact_list};
        return linkString(urlLincChar, parms);
    }


    /**
     * 更新用户话题顺序
     */
    public static String getRefreshSequence() {
        String[] parms = {ENV.getHttpHost(), usertopic, v1, refresh_sequence};
        return linkString(urlLincChar, parms);
    }

    /**
     * 删除某联系人
     */
    public static String deleteContact() {
        String[] parms = {ENV.getHttpHost(), dialog, v1, delete_contact};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取私聊标题
     */
    public static String getDirectchatTitle() {
        String[] parms = {ENV.getHttpHost(), directchat, v1, get_title};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取群聊title全文
     */
    public static String getGroupTitle() {
        String[] parms = {ENV.getHttpHost(), group, v1, get_title};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取我的收藏帖子
     */
    public static String getCollectionForum() {
        String[] parms = {ENV.getHttpHost(), forum, v1, get_collection_forum};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取我的帖子
     */
    public static String getMyForum() {
        String[] parms = {ENV.getHttpHost(), forum, v1, get_my_forum};
        return linkString(urlLincChar, parms);
    }

    /**
     * 修改头像
     */
    public static String setUrl() {
        String[] parms = {ENV.getHttpHost(), user, v1, set_url};
        return linkString(urlLincChar, parms);
    }

    /**
     * 修改用户昵称
     */
    public static String setNickName() {
        String[] parms = {ENV.getHttpHost(), user, v1, set_nickname};
        return linkString(urlLincChar, parms);
    }

    /**
     * 举报
     */
    public static String ReportForum() {
        String[] parms = {ENV.getHttpHost(), report, v1, report_normal};
        return linkString(urlLincChar, parms);
    }

    /**
     * 投诉
     */
    public static String complaint() {
        String[] parms = {ENV.getHttpHost(), complaint, v1, complaint_normal};
        return linkString(urlLincChar, parms);
    }

    /**
     * 回复消息列表
     */
    public static String newsGetForumNews() {
        String[] parms = {ENV.getHttpHost(), news, v1, get_forum_news};
        return linkString(urlLincChar, parms);
    }

    /**
     * 用户更改用户话题
     */
    public static String UserTopicBulkTopic() {
        String[] parms = {ENV.getHttpHost(), usertopic, v1, bulk_set_user_topic};
        return linkString(urlLincChar, parms);
    }

    /**
     * 用户申请新话题
     */
    public static String ApplyNewTopic() {
        String[] parms = {ENV.getHttpHost(), topic, v1, apply_new_topic};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取消息页面的通知列表
     */
    public static String ListNotice() {
        String[] parms = {ENV.getHttpHost(), notice, v1, list_notice};
        return linkString(urlLincChar, parms);
    }

    /**
     * 同意加群申请
     */
    public static String acceptJoinGropNotice() {
        String[] parms = {ENV.getHttpHost(), group, v1, accept_join_group_notice};
        return linkString(urlLincChar, parms);
    }

    /**
     * 拒绝加群申请
     */
    public static String denyJoinGropNotice() {
        String[] parms = {ENV.getHttpHost(), group, v1, deny_join_group_notice};
        return linkString(urlLincChar, parms);
    }

    /**
     * 准备创建相亲角
     */
    public static String prepareAdd() {
        String[] parms = {ENV.getHttpHost(), dating, v1, prepare_add};
        return linkString(urlLincChar, parms);
    }

    /**
     * 创建相亲角
     */
    public static String addDating() {
        String[] parms = {ENV.getHttpHost(), dating, v1, add};
        return linkString(urlLincChar, parms);
    }

    /**
     * 相亲角
     */
    public static String datingList() {
        String[] parms = {ENV.getHttpHost(), dating, v1, list};
        return linkString(urlLincChar, parms);
    }

    /**
     * 相亲角详情
     */
    public static String getDatingDetail() {
        String[] parms = {ENV.getHttpHost(), dating, v1, get_dating_detail};
        return linkString(urlLincChar, parms);
    }

    /**
     * 置顶相亲角
     */
    public static String setTop() {
        String[] parms = {ENV.getHttpHost(), dating, v1, set_top};
        return linkString(urlLincChar, parms);
    }

    /**
     * 删除相亲角
     */
    public static String deleteDating() {
        String[] parms = {ENV.getHttpHost(), dating, v1, delete_dating};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取需要编辑相亲角贴子的详情
     */
    public static String prepareSetDatingInfo() {
        String[] parms = {ENV.getHttpHost(), dating, v1, prepare_set_dating_info};
        return linkString(urlLincChar, parms);
    }

    /**
     * 编辑相亲角接口
     */
    public static String setDatingInfo() {
        String[] parms = {ENV.getHttpHost(), dating, v1, set_dating_info};
        return linkString(urlLincChar, parms);
    }

    /**
     * 查看聊天许可
     */
    public static String checkChatPermission() {
        String[] parms = {ENV.getHttpHost(), directchat, v1, check_chat_permission};
        return linkString(urlLincChar, parms);
    }

    /**
     * 创建私聊
     */
    public static String addDirectchat() {
        String[] parms = {ENV.getHttpHost(), directchat, v1, add};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取私聊历史记录
     */
    public static String getSearchHistory() {
        String[] parms = {ENV.getHttpHost(), search, v1, get_search_history};
        return linkString(urlLincChar, parms);
    }

    /**
     * 搜索话题
     */
    public static String getSearch() {
        String[] parms = {ENV.getHttpHost(), search, v1, search};
        return linkString(urlLincChar, parms);
    }

    /**
     * 删除我的贴子
     */
    public static String deleterMyforum() {
        String[] parms = {ENV.getHttpHost(), forum, v1, delete_my_forum};
        return linkString(urlLincChar, parms);
    }

    /**
     * 更新地理位置
     */
    public static String setUserLocation() {
        String[] parms = {ENV.getHttpHost(), user, v1, set_user_location};
        return linkString(urlLincChar, parms);
    }

    /**
     * 群聊置顶
     */
    public static String setGroupTop() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_group_top};
        return linkString(urlLincChar, parms);
    }

    /**
     * 设置群聊昵称
     */
    public static String setGroupTitle() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_group_title};
        return linkString(urlLincChar, parms);
    }

    /**
     * 设置群头像
     */
    public static String setGroupUrl() {
        String[] parms = {ENV.getHttpHost(), group, v1, set_group_url};
        return linkString(urlLincChar, parms);
    }

    /**
     * 删除搜索记录
     */
    public static String deleteSearchHistory() {
        String[] parms = {ENV.getHttpHost(), search, v1, delete_search_history};
        return linkString(urlLincChar, parms);
    }

    /**
     * 更新APK
     */
    public static String checkAndroidVersion() {
        String[] parms = {ENV.getHttpHost(), system, v1, check_android_version};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取投诉id
     */
    public static String getComplaintID() {
        String[] parms = {ENV.getHttpHost(), complaint, v1, prepare_complaint};
        return linkString(urlLincChar, parms);
    }

    /**
     * 发送融云消息给后台
     */
    public static String getRongyunMessage() {
        String[] parms = {ENV.getHttpHost(), rongyun, get_rongyun_message_from_app};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取用户管理的群主
     */
    public static String getMyGroup() {
        String[] parms = {ENV.getHttpHost(), group, v1, get_my_group};
        return linkString(urlLincChar, parms);
    }

    /**
     * 获取用户管理的群主
     */
    public static String getMVPListAllTopic() {
        String[] parms = {ENV.getHttpHost(), usertopic, mvp, list_all_mvp_topic};
        return linkString(urlLincChar, parms);
    }
}